#include "luat_base.h"
#include "luat_lcd.h"


#define LUAT_LOG_TAG "ili9341"
#include "luat_log.h"

static const uint16_t ili9341_init_cmds[] = {
    // 发送初始化命令
    0x02CF,0x0300,0x03D9,0x0330,
    0x02ED,0x0364,0x0303,0x0312,0x0381,
    0x02E8,0x0385,0x0310,0x0378,
    0x02CB,0x0339,0x032C,0x0300,0x0334,0x0302,
    0x02F7,0x0320,
    0x02EA,0x0300,0x0300,
    0x02C0,0x0321,
    0x02C1,0x0312,
    0x02C5,0x0332,0x033C,
    0x02C7,0x03C1,
    0x02C5,0x031A,
    0x0236,0x0300,
    0x023A,0x0355,
    0x02B1,0x0300,0x0318,
    0x02B6,0x030A,0x03A2,
    0x02F2,0x0300,
    0x0226,0x0301,
    0x02E0,0x030F,0x0320,0x031E,0x0309,0x0312,0x030B,0x0350,0x03BA,0x0344,0x0309,0x0314,0x0305,0x0323,0x0321,0x0300,
    0x02E1,0x0300,0x0319,0x0319,0x0300,0x0312,0x0307,0x032D,0x0328,0x033F,0x0302,0x030A,0x0308,0x0325,0x032D,0x030F,
};


luat_lcd_opts_t lcd_opts_ili9341 = {
    .name = "ili9341",
    .init_cmds_len = sizeof(ili9341_init_cmds)/sizeof(ili9341_init_cmds[0]),
    .init_cmds = ili9341_init_cmds,
    .direction0 = 0x08,
    .direction90 = 0xC8,
    .direction180 = 0x78,
    .direction270 = 0xA8
};
